//动态路由的配置
//一个用户没有登入的时候，能访间什么页面?
//没有登入的情况下，只能访问login页面，其它的页面都不需要渲染
//在用户登入之后，根据后台返回的当前用户菜单信息，进行对比，计算出用户的路由配置，通过addroutes动态进行添加

// 下面的路由都是动态创建的，所以在route下面的index文件下，只需要创建login路由
const dynamicRoutes = [

  {
    path: "/",
    component: () => import(/*webpackChunkName:"" */ "../pages/home"),
    redirect: '/welcome',
    children: [
      {
        path: 'vipManger',
        component: () => import(/*webpackChunkName:"vipManger" */ "../pages/home/vipManger"),
        name: 'vipManger',
        redirect: '/vipManger/charge',
        meta: {
          fullPath: '/vipManger',
          icon: 'iconfont icon-VIP3',
          name: 'vip管理'
        },
        children: [
          {
            path: "charge",
            component: () =>
              import(
                    /*webpackChunkName:"vipCharge" */ "../pages/home/vipManger/charge"
              ),
            name: 'charge',
            meta: {
              fullPath: '/vipManger/charge',
              icon: 'iconfont icon-weibiaoti--',
              name: '充值中心'
            },
          },
          {
            path: "order",
            component: () =>
              import(
                    /*webpackChunkName:"viporder" */ "../pages/home/vipManger/order"
              ),
            name: 'order',
            meta: {
              fullPath: '/vipManger/order',
              icon: 'iconfont icon-shouyejiedan',
              name: '订单管理'
            },
          },
        ]
      },
      {
        path: 'preOrder',
        component: () =>
          import(
             /*webpackChunkName:"preOrder" */ "../pages/home/preOrder"
          ),
        name: 'preOrder',
        meta: {
          fullPath: '/preOrder',
          name: '预支付页'
        },
      },
      {
        path: 'payMent',
        component: () =>
          import(
             /*webpackChunkName:"payMent" */ "../pages/home/payMent"
          ),
        name: 'payMent',
        meta: {
          fullPath: '/payMent',
          name: '支付主页'
        },
        children: [
          {
            path: 'pay',
            component: () =>
              import(
             /*webpackChunkName:"pay" */ "../pages/home/payMent/pay"
              ),
            name: 'pay',
            meta: {
              fullPath: '/payMent/pay',
              name: '支付页'
            }
          },
          {
            path: 'paySuccess',
            component: () =>
              import(
             /*webpackChunkName:"paySuccess" */ "../pages/home/payMent/paySuccess"
              ),
            name: 'paySuccess',
            meta: {
              fullPath: '/payMent/paySuccess',
              name: '支付成功页'
            }
          }
        ]
      }
    ]
  },

  //配置404页面
  {
    path: "*", //*表示的是通配符
    component: () => import(/* webpackChunkName: "404" */ "../pages/page404"),
  },
]
export default dynamicRoutes